let permute = function(){
    // 
    let results = []
    let arr = [];
    function loop(value){
        arr.push(value)
        if(arr.length === nums.length){
            results.push(arr)
        }
        loop()
        
    }

    for(let i=0; i<nums.length; i++){
        loop(nums[i], )
    }
}

let nums = [1,2,3]